package com.example.spring.controller;

import com.alibaba.fastjson.JSONObject;

import com.example.spring.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;



@RestController
public class UserController {


    @Resource
    private UserService userService;


    private Logger logger = LoggerFactory.getLogger(getClass());
    @GetMapping("/demos")
    public JSONObject demo() {
        JSONObject result = new JSONObject();
        result.put("name", "张三23");
        result.put("id", "92382");
        logger.info("测试日志");

        result.put("user", userService.getUser());



        return result;
    }

    @RequestMapping("/logUser")
    public  String users() {
        return "ksdk2";
    }


}
